package cn.jtcoding.xhs.controller;

import cn.jtcoding.xhs.model.vo.NoteVO;
import cn.jtcoding.xhs.service.NoteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author jason.tang
 * @Date 2020/8/4 17:46
 * @Desc
 */

@Api(tags = "笔记")
@RestController
@RequestMapping("/notes")
public class NoteController {

    @Autowired
    private NoteService noteService;

    @ApiOperation(value = "根据分类编号获取笔记")
    @GetMapping("")
    public List<NoteVO> getNotesByCategoryNum(@RequestParam("category") Integer categoryNum) {
        return noteService.getNotesByCategoryNum(categoryNum);
    }

}
